<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>新增学生</title>
</head>
<body>
    <h1>新增学生</h1>
    <form th:action="@{/students/}" th:object="${student}" method="post">
        <div>
            <label>姓名：</label>
            <input type="text" th:field="*{name}">
            <span th:if="${#fields.hasErrors('name')}" th:errors="*{name}"></span>
        </div>
        <div>
            <label>Java成绩：</label>
            <input type="number" th:field="*{javaScore}">
            <span th:if="${#fields.hasErrors('javaScore')}" th:errors="*{javaScore}"></span>
        </div>
        <button type="submit">保存</button>
    </form>
    <br>
    <a th:href="@{/teachers/}">返回列表</a>
</body>
</html> 